﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace Twi.COMMON.Core
{
    /**
     * Author:feitianxinhong
     * Create Date:2015-04-28
     * Description:XElement扩展方法
     */
    public static class ExtensionXElement
    {
        /// <summary>
        /// 将XElement对象转换为XmlNode
        /// </summary>
        /// <param name="xel"></param>
        /// <returns></returns>
        public static XmlNode ToXmlNode(this XElement xel)
        {
            using (XmlReader xmlReader = xel.CreateReader())
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(xmlReader);
                return xmlDoc;
            }
        }
    }
}
